package cn.com.dhcc.adam.spring.mvc.six;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ExtendedModelMap;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/six")
public class RTestController {

	@RequestMapping("/str")
	public String str(Model model) {
		model.addAttribute("res", "return String");
		return "six/rtresult";
	}
	
	@RequestMapping("/mod")
    public Model mod() {
       Model model=new ExtendedModelMap();
       model.addAttribute("res", "return Model");
       return model;
    }

	@RequestMapping("/mav")
	public ModelAndView mav(Model model) {
		model.addAttribute("res", "return ModelAndView");
		ModelAndView mav = new ModelAndView("six/rtresult");
		return mav;
	}

	@RequestMapping("/map")
	public Map<String, String> helloWorld() {
		Map<String, String> map = new HashMap<String, String>();
		map.put("res", "return map");
		return map;
	}

}
